local heqia_viewas = fk.CreateSkill {

  name = "joy__heqia_viewas",

  tags = {  },

}



heqia_viewas:addEffect("active", {
  name = "joy__heqia_viewas",
  interaction = function(self,player)
    local names = {}
    for _, id in ipairs(Fk:getAllCardIds()) do
      local card = Fk:getCardById(id)
      if card.type == Card.TypeBasic and not card.is_derived and player:canUse(card) and not player:prohibitUse(card) then
        table.insertIfNeed(names, card.name)
      end
    end
    if #names == 0 then return end
    return UI.ComboBox {choices = names}
  end,
  card_filter = function(self, player, to_select, selected)
    return #selected == 0 and Fk:currentRoom():getCardArea(to_select) ~= Card.PlayerEquip
  end,
  target_filter = function(self, player, to_select, selected)
    if not self.interaction.data or #selected_cards ~= 1 then return false end
    if #selected >= player:getMark("heqia-tmp") then return false end
    local to_use = Fk:cloneCard(self.interaction.data)
    to_use.skillName = "heqia"
    if player:isProhibited(Fk:currentRoom():getPlayerById(to_select), to_use) then return false end
    return to_use.skill:modTargetFilter(to_select, selected, player.id, to_use, false)
  end,
  feasible = function(self, player, selected, selected_cards)
    if not self.interaction.data or #selected_cards ~= 1 then return false end
    local to_use = Fk:cloneCard(self.interaction.data)
    to_use.skillName = "heqia"
    if to_use.skill:getMinTargetNum() == 0 then
      return (#selected == 0 or table.contains(selected, player.id)) and to_use.skill:feasible(selected, selected_cards, player, to_use)
    else
      return #selected > 0
    end
  end,
})

return heqia_viewas